{extend name="base" /}
{block name="body"}
<div class="layui-container mt20">
    <div class="layui-carousel" id="index_carousel">
        <div carousel-item>
            {foreach name="slide" item="vo"}
            <div class="slide-pic"><a href="{$vo.url}" target="{$vo.target}"><img src="{$vo.image}" alt="{$vo.description}" ></a></div>
            {/foreach}
        </div>
    </div>
</div>
<div class="layui-container">
    <div class="layui-row">
        <div class="layui-col-md4 layui-col-md-offset4">
            <fieldset class="layui-elem-field layui-field-title  ">
                <legend>精品课程</legend>
            </fieldset>
        </div>
        <div class="layui-col-md12 yxt-course-box">
            <div class="layui-tab layui-tab-brief">
                <ul class="layui-tab-title mb20">
                    <li class="layui-this">全部课程</li>
                    <li>点播课程</li>
                    <li>直播课程</li>
                </ul>
                <div class="layui-tab-content">
                    <div class="layui-tab-item layui-show">
                        <div class="yxt_course-list">
                            <div class="layui-row layui-col-space20">
                                {foreach name="allCourse" item="vo"}
                                <div class="layui-col-md3 course-pic">
                                    <div class="yxt_course-item">
                                        <div class="yxt_course-img">
                                            <a href="{:url('index/course/info',array('id'=>hashids_encode($vo['id']),'type'=>hashids_encode($vo['type'])))}">
                                                <img src="{$vo['picture']}" alt="{$vo['title']}" class="img-responsive">
                                                {if condition="$vo['type']==2"}
                                                <span class="tags">
                                                    <span class="tag-live"></span>
                                                </span>
                                                {/if}
                                            </a>
                                        </div>
                                        <div class="yxt_course-info">
                                            <div class="title">
                                                <a class="link-dark" href="{:url('index/course/info',array('id'=>hashids_encode($vo['id']),'type'=>hashids_encode($vo['type'])))}">
                                                    {$vo['title']}
                                                </a>
                                            </div>
                                            <div class="metas clearfix">
                                                <span class="num"><i class="fa fa-user fa-fw"></i>&nbsp;{$vo.id|getUserNum=###,$vo['type']}</span>
                                                <span class="comment"><i class="fa fa-eye fa-fw"></i>&nbsp;{$vo.views}</span>
                                                {if condition="$vo['price']==0"}
                                                <span class="free"> <i class="layui-icon layui-icon-rmb mr5"></i>免费</span>
                                                {else /}
                                                <span class="price"> <i class="layui-icon layui-icon-rmb mr5"></i>{$vo['price']}</span>
                                                {/if}
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                {/foreach}
                            </div>
                        </div>
                    </div>
                    <div class="layui-tab-item">
                        <div class="yxt_course-list">
                            <div class="layui-row layui-col-space20">
                                {foreach name="videoCourse" item="vo"}
                                <div class="layui-col-md3 course-pic">
                                    <div class="yxt_course-item">
                                        <div class="yxt_course-img">
                                            <a href="{:url('index/course/info',array('id'=>hashids_encode($vo['id']),'type'=>hashids_encode($vo['type'])))}">
                                                <img src="{$vo['picture']}" alt="{$vo['title']}" class="img-responsive">
                                            </a>
                                        </div>
                                        <div class="yxt_course-info">
                                            <div class="title">
                                                <a class="link-dark" href="{:url('index/course/info',array('id'=>hashids_encode($vo['id']),'type'=>hashids_encode($vo['type'])))}">
                                                    {$vo['title']}
                                                </a>
                                            </div>
                                            <div class="metas clearfix">
                                                <span class="num"><i class="fa fa-user fa-fw"></i>&nbsp;{$vo.id|getUserNum=###,$vo['type']}</span>
                                                <span class="comment"><i class="fa fa-eye fa-fw"></i>&nbsp;{$vo.views}</span>
                                                {if condition="$vo['price']==0"}
                                                <span class="free"> <i class="layui-icon layui-icon-rmb mr5"></i>免费</span>
                                                {else /}
                                                <span class="price"> <i class="layui-icon layui-icon-rmb mr5"></i>{$vo['price']}</span>
                                                {/if}
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                {/foreach}
                            </div>
                        </div>
                    </div>
                    <div class="layui-tab-item">
                        <div class="yxt_course-list">
                            <div class="layui-row layui-col-space20">
                                {foreach name="liveCourse" item="vo"}
                                <div class="layui-col-md3 course-pic">
                                    <div class="yxt_course-item">
                                        <div class="yxt_course-img">
                                            <a href="{:url('index/course/info',array('id'=>hashids_encode($vo['id']),'type'=>hashids_encode($vo['type'])))}">
                                                <img src="{$vo['picture']}" alt="{$vo['title']}" class="img-responsive">
                                                <span class="tags">
                                                    <span class="tag-live"></span>
                                                </span>
                                            </a>
                                        </div>
                                        <div class="yxt_course-info">
                                            <div class="title">
                                                <a class="link-dark" href="{:url('index/course/info',array('id'=>hashids_encode($vo['id']),'type'=>hashids_encode($vo['type'])))}">
                                                    {$vo['title']}
                                                </a>
                                            </div>
                                            <div class="metas clearfix">
                                                <span class="num"><i class="fa fa-user fa-fw"></i>&nbsp;{$vo.id|getUserNum=###,$vo['type']}</span>
                                                <span class="comment"><i class="fa fa-eye fa-fw"></i>&nbsp;{$vo.views}</span>
                                                {if condition="$vo['price']==0"}
                                                <span class="free"> <i class="layui-icon layui-icon-rmb mr5"></i>免费</span>
                                                {else /}
                                                <span class="price"> <i class="layui-icon layui-icon-rmb mr5"></i>{$vo['price']}</span>
                                                {/if}
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                {/foreach}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="layui-container">
    <div class="layui-row">
        <div class="layui-col-md4 layui-col-md-offset4 mb40">
            <fieldset class="layui-elem-field layui-field-title  ">
                <legend>推荐团队</legend>
            </fieldset>
        </div>
        <div class="layui-col-md12 yxt-course-box mt20">
            <div class="yxt_course-list">
                <div class="layui-row layui-col-space20">
                    {foreach name="classroom" item="vo"}
                    <div class="layui-col-md3 course-pic">
                        <div class="yxt_course-item">
                            <div class="yxt_course-img">
                                <a href="{:url('index/classroom/info',array('id'=>hashids_encode($vo['id'])))}">
                                    <img src="{$vo['picture']}" alt="{$vo['title']}" class="img-responsive">
                                    <div class="layer">
                                        <ul>
                                            <li><i class="layui-icon layui-icon-friends"></i><span>{$vo.id|getUserNum=###,$vo['type']}</span> 人已加入学习</li>
                                            <li><i class="layui-icon layui-icon-template-1"></i><span>{$vo['id']|getClassroomCourseNum}</span> 个课程</li>
                                            <li><i class="layui-icon layui-icon-rmb"></i><span>{$vo['price']}元</span></li>
                                        </ul>
                                    </div>
                                    <div class="classroom-tag hz-triangle"><span>班级</span></div>
                                </a>
                            </div>
                            <div class="yxt_course-info" style="padding: 15px;">
                                <div class="title">
                                    <a class="link-dark" href="{:url('index/classroom/info',array('id'=>hashids_encode($vo['id'])))}">
                                        {$vo['title']}
                                    </a>
                                </div>
                                <a href="{:url('index/classroom/info',array('id'=>hashids_encode($vo['id'])))}" type="button" class="layui-btn layui-btn-fluid mt10">加入班级</a>
                            </div>
                        </div>
                    </div>
                    {/foreach}
                </div>
            </div>
        </div>
    </div>
</div>
<div class="layui-container mb50">
    <div class="layui-row">
        <div class="layui-col-md4 layui-col-md-offset4">
            <fieldset class="layui-elem-field layui-field-title">
                <legend>个人推荐</legend>
            </fieldset>
        </div>
        <div class="yxt_teacher-list">
            <div class="layui-row layui-col-space20">
                {foreach name="teacher" item="vo"}
                <div class="layui-col-md4">
                    <div class="tea-list">
                        <a target="_blank" title="金牌讲师 · "{$vo.id|getTeacherName} href="{:url('index/teacher/centert',['id'=>hashids_encode($vo.id)])}">
                            <div class="tea-item-wrap">
                                <aside class="i-tea-pic">
                                    <img alt="金牌讲师 · "{$vo.id|getTeacherName} src="{$vo.uid|getAvatar|defaultAvatar}">
                                </aside>
                                <h3 class="tea-title  txtOf unFw">金牌讲师 · {$vo.id|getTeacherName}</h3>
                                <section class="i-q-txt">
                                    <p><span class="tea-info-txt fsize14">{$vo.brief}</span></p>
                                </section>
                                <section class="tea-bottom">
                                    <i class="tea-go-icon fa fa-arrow-right"></i>
                                </section>
                            </div>
                        </a>
                    </div>
                </div>
                {/foreach}
            </div>
        </div>
    </div>
</div>
<div class="layui-layout bg-f8fafc pdb40 mt50">
    <div class="layui-container">
        <div class="layui-row" >
            <div class="layui-col-md4 layui-col-md-offset4 mb20">
                <fieldset class="layui-elem-field layui-field-title">
                    <legend>最新资讯</legend>
                </fieldset>
            </div>
            <div class="yxt_art_list">
                <div class="layui-row layui-col-space30">
                    {foreach name="article" item="vo"}
                    <div class="layui-col-md6 ">
                        <div class="yxt_art-item layui-col-space15">
                            <div class="layui-col-md4 ">
                                <a href="{:url('index/article/contents',['id'=>hashids_encode($vo.id)])}" target="_blank">
                                    <img src="{$vo.image}" alt="{$vo.title}" class="img-responsive">
                                </a>
                            </div>
                            <div class="layui-col-md8 pdr20 ">
                                <div class="metas">
                                    <h3 class="hLh30 txtOf"> <a target="_blank" class="i-art-title" href="{:url('index/article/contents',['id'=>hashids_encode($vo.id)])}" title="{$vo.title}">{$vo.title}</a> </h3>
                                    <section class="i-q-txt mt10 i-q-txt2"> <p> <span class="c-999"> {$vo.summary}</span> </p></section>
                                    <section class="hLh30 txtOf">
                                        <span class="fl mr50"> <i  class="fa fa-eye fa-fw">&nbsp;</i > <tt class="fsize12 c-999 f-fM vam">{$vo.view}</tt> </span>
                                        <span class="fr"> <i  class="layui-icon layui-icon-log">&nbsp;</i > <tt class="fsize12 c-999 f-fM vam">{$vo.create_time} </tt> </span>
                                    </section>
                                </div>
                            </div>
                        </div>
                    </div>
                    {/foreach}
                </div>
            </div>
        </div>
    </div>
</div>
{/block}
{block name="js"}
<script>
    layui.use(['carousel'], function(){
        var carousel = layui.carousel;
        carousel.render({
            elem: '#index_carousel'
            ,width: '100%'
            ,arrow: 'hover'
            ,anim:'fade'
            ,
        });
    });
</script>
{/block}